#include<stdio.h>
#include<stdlib.h>
#include<fcntl.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/stat.h>

int main()
{
	struct stat st;

	int res = stat("b.txt",&st);
	if(res == -1){
		perror("stat");
		return -1;
	}
	printf("文件对应设备ID = %d\n",st.st_dev);
	printf("inode = %d\n",st.st_ino);
	printf("nlink = %d\n",st.st_nlink);
	printf("uid = %d,gid = %d\n",st.st_uid,st.st_gid);
	printf("size = %d\n",st.st_size);
	printf("blocksize = %d\n",st.st_blksize);
	printf("blocks = %d\n",st.st_blocks);

	return 0;
}